package com.liuxin.zhiyuan.shujuzhongxin.controller;

import java.util.Arrays;
import java.util.Map;
import com.liuxin.zhiyuan.shujuzhongxin.domain.po.YuanxiaoinfoEntity;
import com.liuxin.zhiyuan.shujuzhongxin.service.YuanxiaoinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.liuxin.common.utils.PageUtils;
import com.liuxin.common.utils.R;

/**
 * 院校表
 *
 * @author zsl
 * @email 1301966496@qq.com
 * @date 2025-09-21 22:19:29
 */
@RestController
@RequestMapping("shujuzhongxin/lxzyyuanxiaoinfo")
public class YuanxiaoinfoController {
    @Autowired
    private YuanxiaoinfoService yuanxiaoinfoService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("user:lxzyyuanxiaoinfo:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = yuanxiaoinfoService.queryPage(params);
        return R.ok().put("data", page);
    }

    /**
     * 信息
     */
    @RequestMapping("/info")
    //@RequiresPermissions("user:lxzyyuanxiaoinfo:info")
    public R info(@RequestParam("id") Long id){
		YuanxiaoinfoEntity lxzyYuanxiaoinfo = yuanxiaoinfoService.getSchoolWithScoreLines(id);
        return R.ok().put("data", lxzyYuanxiaoinfo);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("user:lxzyyuanxiaoinfo:save")
    public R save(@RequestBody YuanxiaoinfoEntity lxzyYuanxiaoinfo){
		yuanxiaoinfoService.save(lxzyYuanxiaoinfo);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
   //@RequiresPermissions("user:lxzyyuanxiaoinfo:update")
    public R update(@RequestBody YuanxiaoinfoEntity lxzyYuanxiaoinfo){
		yuanxiaoinfoService.updateById(lxzyYuanxiaoinfo);
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("user:lxzyyuanxiaoinfo:delete")
    public R delete(@RequestBody Long[] ids){
		yuanxiaoinfoService.removeByIds(Arrays.asList(ids));
        return R.ok();
    }

}
